#ifndef MapItem_H
#define MapItem_H

#include <QGraphicsPixmapItem>
#include <QList>

QT_BEGIN_NAMESPACE
class QPixmap;
class QGraphicsItem;
class QGraphicsScene;
class QTextEdit;
class QGraphicsSceneMouseEvent;
class QMenu;
class QGraphicsSceneContextMenuEvent;
class QPainter;
class QStyleOptionGraphicsItem;
class QWidget;
class QPolygonF;
QT_END_NAMESPACE


class MapItem : public QGraphicsPixmapItem
{
public:
    enum { Type = UserType + 15 };
    enum DiagramType {RoadSolidVertical = UserType + 500, RoadSolidHorizontal, RoadEmpty, 
						CornerDL, CornerDR, CornerUL, CornerUR,
						DashD, DashL, DashU, DashR,
						SolidL, SolidD, SolidU, SolidR,
						IntersectionR, IntersectionL, IntersectionD, IntersectionU,
						Start, End,
						Step, Conditional, StartEnd, Io, Path};

    MapItem(DiagramType diagramType, QMenu *contextMenu,
        QGraphicsItem *parent = 0, QGraphicsScene *scene = 0);

    DiagramType diagramType() const
        { return myDiagramType; }
    QPolygonF polygon() const
        { return myPolygon; }
    QPixmap image() const;
    int type() const
        { return Type;}

protected:
    void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
    QVariant itemChange(GraphicsItemChange change, const QVariant &value);

public:
    DiagramType myDiagramType;
    QPolygonF myPolygon;
    QMenu *myContextMenu;
	int entryId;
};

#endif
